package com.ancun.annocation;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.ancun.entity.Book;

public interface BookMapper {

    @Insert("insert into book(id,bookname) values(#{id},#{bookName})")
    public int add(Book book);

    @Select("select * from book where id = #{id}")
    public Book getBook(int id);

    @Update("update book set bookname=#{bookName} where id = #{id}")
    public int updateBook(Book book);

    @Delete("delete from book where id=#{id}")
    public int deleteBook(int id);
}

